<?php

namespace App;

namespace App\Model;

/**
 * App\Station
 *
 * @property int $id
 * @property int $distributor_id 分销商
 * @property array $images 图片些
 * @property string $name 名称
 * @property string|null $description 简介
 * @property string $address 位置
 * @property string $lat 位置
 * @property string $lng 位置
 * @property int $discount 折扣 100为不打折
 * @property string|null $remark 备注
 * @property int $is_active 是否可用
 */
class YStation extends Model
{
    //
    public bool $timestamps = true;

    protected ?string $table = 'y_stations';

    protected array $fillable = [
        'name', 'address', 'lat', 'lng', 'images','distributor_id','description',
        'discount','remark','charge_id','is_return_fee','is_active',
        'province_id','city_id','area_id','province_name','city_name',
        'area_name','class_id','push_time','siteScene','siteType','fireFacilities',
        'canopyFlag','districtCode'
    ];

    protected array $casts = [
        'images' => 'json'
    ];



    public function device(){
        return $this->hasMany(YDevice::class,'station_id','id');
    }

}
